﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class MasterPage : System.Web.UI.MasterPage {
	protected void Page_Load(object sender, EventArgs e) {
		AbstractPage loginViewPage = (AbstractPage) this.Page;
		User user = (User) Session[AbstractPage.SESSION_USER];
		if (user != null) {
			this.lblLoginView.Text = "Logged in as: " + user.Email;
			this.btnSignOut.Visible = true;
		} else {
			this.lblLoginView.Text = "Not Logged In";
			this.btnSignOut.Visible = false;
		}
	}

	protected void btnSignOut_Click(object sender, EventArgs e) {
		this.Session.Remove(AbstractPage.SESSION_USER);
		Server.Transfer("index.aspx", true);
	}
}
